import request from '@/utils/request'

let phoneApi = {

  // 获取手机列表
  getList(query) {
    return request({
      url: '/account/tel/manage/list',
      method: 'get',
      params: query

    })
  },
  // 获取所有手机列表
  getAllList(query) {
    return request({
      url: '/account/tel/manage/allList',
      method: 'get',
      params: query

    })
  },
  //新增
  addPhone(data) {
    return request({
      url: '/account/tel/manage',
      method: 'post',
      data: data
    })
  },
  //编辑
  editPhone(data) {
    return request({
      url: '/account/tel/manage',
      method: 'put',
      data
    })
  },
  //APP接码列表  智能卡位接收短信列表
  appMessagelist(params) {
    return request({
      url: '/appMessage/list',
      method: 'get',
      params
    })
  },
  //APP接码新消息弹出
  appMessageNewSMS(params) {
    return request({
      url: '/appMessage/quertyList',
      method: 'get',
      params
    })
  },

  // 获取绑定记录
  goodsPhoneRecord(query) {
    return request({
      url: '/goodsPhoneRecord/list',
      method: 'get',
      params: query

    })
  },
  // 查询单可出租的手机号列表
  getleaseList(query) {
    return request({
      url: '/account/tel/manage/leaseList',
      method: 'get',
      params: query

    })
  },
  // 提交可出租的手机号
  updateIsLease(data) {
    return request({
      url: '/account/tel/manage/updateIsLease',
      method: 'post',
      data
    })
  },

  // 将手机号移除出租池
  removeIsLease(data) {
    return request({
      url: '/account/tel/manage/removeIsLease',
      method: 'post',
      data
    })
  },

  // 出租下单页  获取可出租手机号数量
  // /telLeaseDetails/getLeaseInfo
  getLeaseInfo(params) {
    return request({
      url: '/telLeaseDetails/getLeaseInfo',
      method: 'get',
      params
    })
  },
  // 确认出租  下单
  telLeaseDetailsSave(data) {
    return request({
      url: '/telLeaseDetails/save',
      method: 'post',
      data
    })
  },
  // 根据id修改手机出租详情(关系表)
  telLeaseDetailsEdit(data) {
    return request({
      url: '/telLeaseDetails',
      method: 'put',
      data
    })
  },
  // 根据id删除手机出租详情(关系表)
  telLeaseDetailsDel(ids) {
    return request({
      url: `/telLeaseDetails/${ids}`,
      method: 'delete'
    })
  },
  // 我租用的卡位列表 /telLeaseDetails/myZuLin
  telLeaseDetailslist(params) {
    return request({
      url: '/telLeaseDetails/myZuLin',
      method: 'get',
      params
    })
  },
  // 我出租的卡位列表
  telLeaseDetailslistmyChuZu(params) {
    return request({
      url: '/telLeaseDetails/myChuZu',
      method: 'get',
      params
    })
  },
  // 发送短信 /account/tel/manage/telSend
  telSendSms(data,headers) {
    return request({
      url: '/account/tel/manage/telSend',
      method: 'post',
      headers:{
        ...headers
      },
      data
    })
  },

  // 发送的短信记录查询
  telManageSendRecordlist(params) {
    return request({
      url: '/telManageSendRecord/list',
      method: 'get',
      params
    })
  },

  // 智能卡位 推送短信 
  cardMessage(data) {
    return request({
      url: '/appMessage/cardMessage',
      method: 'post',
      data
    })
  },

  //出租卡位号商列表  按开通的服务查询店铺列表
  getIsLeaseTenantList(params) {
    return request({
      url: '/valueAddedService/getTenantByGroupKey',
      method: 'get',
      params
    })
  },
  // 删除卡位
  delPhone(ids) {
    return request({
      url: `/account/tel/manage/${ids}`,
      method: 'delete'
    })
  },
  // 导出批量添加模版 /account/tel/manage/exportModel
  exportModel() {
    return request({
      url: `/account/tel/manage/exportModel`,
      responseType: 'blob',
      method: 'get'
    })
  },

  // 分享短信
  appMessageShare(data) {
    return request({
      url: '/appMessageShare',
      method: 'post',
      data
    })
  },
  // 查询分享列表 /appMessageShare/list
  getAppMessageShareList(params) {
    return request({
      url: '/appMessageShare/list',
      method: 'get',
      params
    })
  },
  // 立即失效
  appMessageShareEdit(data) {
    return request({
      url: '/appMessageShare',
      method: 'put',
      data
    })
  },

  // 核对状态
  telHedui(data) {
    return request({
      url: '/account/tel/manage/hedui',
      method: 'post',
      data
    })
  },
  // 查询核对记录
  getHeDuijilu(params) {
    return request({
      url: '/telManageHeduiRecord/list',
      method: 'get',
      params
    })
  },
  // 查询可以用于分配共享的手机号  /telLeaseDetails/getWeiGongXiang
  getWeiGongXiang(params) {
    return request({
      url: '/telLeaseDetails/getWeiGongXiang',
      method: 'get',
      params
    })
  },

  //加入共享 新
  telLeaseDetailsSaveGX(data) {
    return request({
      url: '/telLeaseDetails/saveGX',
      method: 'post',
      data
    })
  },
  // 查询有共享卡位的商家列表
  telLeaseDetailsGongxianglist(params) {
    return request({
      url: '/telLeaseDetails/gongxianglist',
      method: 'get',
      params
    })
  },
  // 共享市场下单
  telShareOrderPay(data) {
    return request({
      url: '/telShareOrder/pay',
      method: 'post',
      data
    })
  },
  // 卡位共享订单 /telShareOrder/list
  telShareOrderList(params) {
    return request({
      url: '/telShareOrder/list',
      method: 'get',
      params
    })
  },

  // 拿共享订单ID获取订单当前有效号码数量和管理方的共享配置
  getNumAndSetting(params) {
    return request({
      url: '/telShareOrder/getNumAndSetting',
      method: 'get',
      params
    })
  },
  // 共享市场续费
  telShareOrderRenewal(data) {
    return request({
      url: '/telShareOrder/renewal',
      method: 'post',
      data
    })
  },

   // 根据id删除手机出租详情(关系表)  新
   telLeaseDetailsDelNew(data) {
    return request({
      url: `/telLeaseDetails/del`,
      method: 'post',
      data
    })
  },
  // 查询共享订单中的手机号列表 /telShareInfo/list
  telShareInfolist(params) {
    return request({
      url: '/telShareInfo/list',
      method: 'get',
      params
    })
  },

  // 批量 强制到期
  telLeaseDetailsqiangzhi(data) {
    return request({
      url: '/telLeaseDetails/qiangzhi',
      method: 'post',
      data
    })
  },

  // 获取短信内容
  getSmsContent(id) {
    return request({
      url: `/appMessage/look/${id}`,
      method: 'get'
    })
  },

  // 短信查询记录
  smsLookRec(params) {
    return request({
      url: `/appMessageLook/list`,
      method: 'get',
      params
    })
  },
  telCallLoglist(params) {
    return request({
      url: `/telCallLog/list`,
      method: 'get',
      params
    })
  },
  // 设备开关灯
  switchLight(data) {
    return request({
      url: `/account/tel/manage/switchLight`,
      method: 'post',
      data
    })
  },
}
export default phoneApi

